There have been conventionally known the following bending angle detectors incorporated in bending machines such as press brakes.
(a) Contact type detectors which detect a bending angle of a workpiece, bringing a probe into contact with an inclined surface of the workpiece (e.g., Japanese Patent Publication Laid-Open No. 1-273618 (1989)).
(b) Non-contact type detectors which include a plurality of distance sensors such as overcurrent sensors, electrostatic capacity sensors or optical sensors and which detect a bending angle of a workpiece by measuring the difference between the distances from the respective distance sensors to the workpiece (e.g., Japanese Patent Publication Laid-Open No. 63-49327 (1988), Japanese Patent Publication Laid-Open No. 64-2723 (1989), Japanese Patent Publication Laid-Open No. 1-271013 (1989)).
These bending angle detectors however present the following drawbacks.
Firstly, the contact-type detectors cannot be suitably used when detecting a bending angle of a workpiece with short legs, as these detectors require comparatively long legs to ensure a high measuring accuracy. Further, if the contact-type detectors are used for a long time, long contact with workpieces causes the probe to be worn and deformed, resulting in a decreased measuring accuracy.
In the case of the non-contact type detectors, a plurality of distance sensors are employed for measuring and calculating the distance from each sensor to a bent workpiece, but a long space cannot be kept between one sensor and another so that a satisfactory detecting accuracy cannot be obtained. Further, the non-contact type detectors employing overcurrent sensors or electrostatic capacity sensors have the disadvantage that since the outputs of these sensors vary depending on the material of a workpiece to be measured, so that measuring conditions have to be changed whenever a different material is used. The non-contact type detectors employing optical sensors also have the disadvantage that light directed to the surface of a workpiece disperses in some surface conditions, which leads to an increased measuring error and a decreased measuring accuracy. Another disadvantage of this type is that the measuring accuracy is dependent on sensors to be used and the resolving power of the image receptor.
One proposal to overcome the foregoing drawbacks is set out in Japanese Patent Publication Laid-Open No. 4-145315 (1992) where a slit light or two spot lights are directed onto the surface of a workpiece and a light image formed on the surface of the workpiece is photographed by a photographing means to detect a bending angle through image processing. In this bending angle detector, an optical system is arranged such that, as shown in FIG. 28, the optical axis of incident light upon the photographing means (i.e., camera) lies within a plane perpendicular to the irradiated surface of the workpiece W. In this arrangement, the following equations hold: EQU tan .theta.'=d/l (a) EQU tan .theta.=h/l (b) EQU tan .alpha.=d/h (c)
where .alpha. is a beam projecting angle, i.e., the angle at which a slit light (or two spot lights) is directed onto the surface of the workpiece W; .theta.' is the angle formed by the slit light in an image plane; .theta. is a bending angle of the workpiece W (hereinafter referred to as "work angle"); and d, h, l respectively represent the lengths shown in FIG. 28.
From Equations (a), (b) and (c), the following equation (d) is obtained. ##EQU1##
In Equation (d), since the beam projecting angle a is given, the work angle .theta. can be obtained by arithmetic operation if the angle .theta.' is detected by image processing.
As one example of the image processing technique, a device which linearizes image using the linear least square method is disclosed in Japanese Patent Publication Laid-Open No. 4-62683 (1992). In this processing device, a straight line component is extracted from a binary image. More specifically, the number of pixels constituting a binary image is reduced without spoiling the straight line approximation characteristics of the binary image, and the straight line component of the binary image is extracted based on the number of remaining pixels.
An alternative proposal is disclosed in Japanese Patent Publication No. 4-70091 (1992) where a bending angle detector attached to a press brake is freely movable so that it can be positioned at a desired position when detecting a bending angle of a workpiece.
However, the bending angle detector according to the first proposal suffers from several disadvantages. Firstly, it has been proved that it is difficult to accurately calculate the work angle .theta. from Equation (d), since the field of a camera serving as the photographing means is spread because of the angle of view of the lens. That is, the relationship between the work angle .theta. and the angle .theta.' formed by the slit light in the image plane is not so simple as Equation (d) when taking the effects of the angle of view of the lens into consideration. In order to calculate the work angle .theta. more accurately, it is necessary to use a function F (.alpha., l.sub.a, f, w . . . ) which involves optical conditions such as the distance l.sub.a between the camera and the workpiece, the focal length f of the lens and the dimension of the image receptor w. In this case, Equation (d) is expressed as follows. ##EQU2##
For calculating the work angle .theta. from Equation (e), a mathematical method may be used to obtain the function F (.alpha., l.sub.a, f, w . . . ), but in such a case, variations in parameters in individual members such as a lens cannot be taken into account and this results in an increased error. Therefore, various parameters in each member should be obtained through experiments. However, it is extremely difficult to carry out rigorous measurement in an optical system. Further, since the distance l.sub.a between the camera and the workpiece, which is one of the parameters, varies according bending processing conditions (die size, the thickness of a sheet-like workpiece, etc.), a specialized means is required for measuring the distance l.sub.a, which brings about a complexity in the mechanism.
Another problem lies in the process in which an image (a linear projected light image) formed on the surface of the workpiece is photographed by the photographing means and image processing is carried out. In the measurement of the image at the job site, an optimum threshold for binary conversion fluctuates due to the influence of external light and the instability of the light source, so that the shape of the bright zone after the binary conversion varies whenever measurement is carried out. Further, unevenness in the color of the surface of a workpiece or rolling traces inherent to steel plates often cause irregular reflection of beams. This irregular reflection leads to such undesirable situations that (i) the bright zone does not assume the shape of a straight line, (ii) the edge becomes rugged, or (iii) holes B are formed in the bright zone A as shown in FIG. 29, and in these situations, it is difficult to obtain a satisfactorily thin linear image. As a result, the image C which has been thinned by image processing has wavy portions or whisker-like portions (short lines) D which are the cause of errors in extracting a main straight line as shown in FIG. 30.
Still another problem arises when a workpiece which has a bent portion is bent. In practical bending processing in which a workpiece is bent with upper and lower dies, a workpiece to be photographed is not always in the form of a flat sheet. When the bending processing is applied to a workpiece having a bent portion, there is a likelihood that the bent portion and/or a part of the lower die are also photographed by the camera. If binary conversion and image thinning process are performed on such an image, an error will be caused in the position of the center of gravity and the inclination of the image.
In spite of the fact that detection of a bending angle of a workpiece by the use of a bending angle detector is difficult or impossible in some cases, for example, where a workpiece of a particular shape is used or a finished article of a particular shape is required, conventional NC devices are not designed to deal with such data concerning the bending angle detector as control data. Therefore, in a bending machine equipped with such a bending angle detector, control operation is difficult to be carried out by means of an NC device.